<?php

use Illuminate\Database\Seeder;

class UsersTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //数据填充

        //创建 方式 cmd  php artisan make:seeder UsersTableSeeder
    	$tmp = [];
    	for($i = 0; $i < 214;$i++)
    	{
    		$user['name'] = str_random(10);
    		$user['password'] = Hash::make('123');
    		$user['status'] = 0;
    		$user['email'] = str_random(5)."@sina.com";
    		$user['pic'] = 'default.jpg';
    		$time = time();
    		$user['created_at'] = $time; 
    		$user['updated_at'] = $time; 
    		$tmp[] = $user;
    	}
    	DB::table('users') -> insert($tmp);
    }
    //运行方式   cmd   php artisan db:seed --class=UsersTableSeeder
}
